import Book.BookList;
import User.User;
import User.AdminUser;
import User.NorUser;
import java.util.Scanner;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-04-12
 * Time: 8:05
 * To BE A Better Person-2020-3-2
 */
//shui
public class Main {
    public static User Login() {
        System.out.println("请输入姓名>:");
        Scanner sc = new Scanner(System.in);
        String name = sc.nextLine();
        //String scc = "12345";
        //System.out.println("请输入密码>:");
        //String sec = sc.nextLine();//确认密码
       // if (scc.equals(sec)) {
        System.out.println("欢迎"+name+"进入系统");
        System.out.println("请输入你的选择：1>:普通用户  2>:管理员");
        int choice = sc.nextInt();
        if (choice == 2) {
            return new AdminUser(name);
        } else {
            return new NorUser(name);
        }
       // }
    }
    //hhh
    public static void main(String[] args) {
        BookList bookList=new BookList();
        int choice;
        User us=Login();
        while(true) {
            us.menu();
            Scanner sc = new Scanner(System.in);
            choice = sc.nextInt();
            us.DoOp(choice,bookList);
        }
    }
}
